<?php
if ($view->viewname == "create") {
	$data = array();
} else {
	$data = $view->getDetailData();
}
$fields = $view->getOrderedFieldList(); ?>

<div>
	<form id="<?php echo $view->modelname; ?>form" action="/<?php echo $view->modelname; ?>/save/?id=<?php echo request::get("id"); ?>" method="post">
		<dl>
<?php foreach($fields as $field) { ?>
			<dt><?php echo $field->caption; ?></dt>
			<dd>
				<?php echo $field->render($data->{$field->name}); ?>			
			</dd>
<?php } ?>	
		</dl>
	</form>
</div>